CMakeLists编译过程问题整理

您所在的位置:网站首页 cmakelists install CMakeLists编译过程问题整理

CMakeLists编译过程问题整理

#CMakeLists编译过程问题整理| 来源: 网络整理| 查看: 265

1.Error computing CMake server result [link](https://blog.csdn.net/Notzuonotdied/article/details/89501285).

下载了cmake 3.6版本,替换android studio sdk 默认装的cmake 3.10版本(Android Studio是3.5的),并且修改local.properties中cmake.dir对应的文件名称和build.gradle中externalNativeBuild的cmake中的version为对应的版本号再重新sync。

2.CMake ‘3.6.0’ was not found in PATH or by cmake.dir property. - CMake ‘3.10.2’ found in SDK did not match requested version ‘3.6.0’.

修改local.properties中cmake.dir对应的文件名称和build.gradle中externalNativeBuild的cmake中的version为对应的版本号再重新sync。

3.CMake Error at CMakeLists.txt:122 (add_library): Cannot find source file:

Android Studio3.5版本在创建项目的时候CMakeLists被创建在app/src/main/cpp目录下,而在CMakeLists编写配置的时候(如下图),CMAKE_SOURCE_DIR被定为到app/src/main/cpp下,所以配置的src/main/…/会定位不到,所以将app/src/main/cpp目录下的CMakeLists剪切到app目录下与src同级,再重新sync。 在这里插入图片描述

4.android Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm…

同样也由于CMakeLists编写问题导致。

5.ninja: error: ‘…/…/…/…/libs/armeabi/libavcodec.so’, needed by …

如下图,主要原因是因为配置target_properties需要引用的so库的位置没有定位到,追溯到distribution_DIR没有编写正确,可以如图用CMAKE_SOURCE_DIR定位CMakeLists的位置,然后后边定位到自己相应存放so库的位置,再sync。在这里插入图片描述

小结

后续再进行补充。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3